define('router', [
	'jquery',
	'underscore',
	'backbone',
	'HomeView'
], function($, _, Backbone, HomeView) {

	var Router = Backbone.Router.extend({
		initialize: function() {
			console.log('router init');
			this.elms = {
				container: $('#container')
			};
		},
		routes: {
			'': 'home',
			'home': 'home',
			'vendor': 'vendor',
		},

		home: function() {
			console.log('router to home');
			if (!this.homeView) {
				this.homeView = new HomeView();
			}
			this.elms['container'].html(this.homeView.render().el);
		},
	})

	return Router;
});